package com.ruoyi.project.jiaqin.recruitindustry.service.impl;

import com.ruoyi.common.utils.text.Convert;
import com.ruoyi.project.jiaqin.recruitindustry.domain.RecruitIndustry;
import com.ruoyi.project.jiaqin.recruitindustry.mapper.RecruitIndustryMapper;
import com.ruoyi.project.jiaqin.recruitindustry.service.IRecruitIndustryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;
import java.util.UUID;

/**
 * 招聘行业Service业务层处理
 *
 * @author admin
 * @date 2021-01-06
 */
@Service
public class RecruitIndustryServiceImpl implements IRecruitIndustryService
{
    @Autowired
    private RecruitIndustryMapper recruitIndustryMapper;

    /**
     * 查询招聘行业
     *
     * @param id 招聘行业ID
     * @return 招聘行业
     */
    @Override
    public RecruitIndustry selectRecruitIndustryById(String id)
    {
        return recruitIndustryMapper.selectRecruitIndustryById(id);
    }

    /**
     * 查询招聘行业列表
     *
     * @param recruitIndustry 招聘行业
     * @return 招聘行业
     */
    @Override
    public List<RecruitIndustry> selectRecruitIndustryList(RecruitIndustry recruitIndustry)
    {
        return recruitIndustryMapper.selectRecruitIndustryList(recruitIndustry);
    }

    /**
     * 新增招聘行业
     *
     * @param recruitIndustry 招聘行业
     * @return 结果
     */
    @Override
    public int insertRecruitIndustry(RecruitIndustry recruitIndustry)
    {
        recruitIndustry.setId(UUID.randomUUID().toString().replace("-",""));
        recruitIndustry.setCreateAt(new Date());
        return recruitIndustryMapper.insertRecruitIndustry(recruitIndustry);
    }

    /**
     * 修改招聘行业
     *
     * @param recruitIndustry 招聘行业
     * @return 结果
     */
    @Override
    public int updateRecruitIndustry(RecruitIndustry recruitIndustry)
    {

        return recruitIndustryMapper.updateRecruitIndustry(recruitIndustry);
    }

    /**
     * 删除招聘行业对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteRecruitIndustryByIds(String ids)
    {
        return recruitIndustryMapper.deleteRecruitIndustryByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除招聘行业信息
     *
     * @param id 招聘行业ID
     * @return 结果
     */
    @Override
    public int deleteRecruitIndustryById(String id)
    {
        return recruitIndustryMapper.deleteRecruitIndustryById(id);
    }
}
